package br.ufmg.vod.collections;

import java.util.Iterator;

public class XRange implements Iterator<Integer> {
	
	private final int end;
	private int i;
	
	public XRange(int end) {
		this(0,end);
	}

	public XRange(int start, int end) {
		this.end = end;
		this.i=start;
	}

	@Override
	public boolean hasNext() {
		return i<end;
	}

	@Override
	public Integer next() {
		return i++;
	}

	@Override
	public void remove() {
		throw new UnsupportedOperationException();
	}

}
